
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>

<div class="modal" id="selectPeriodNameDiv" tabindex="-1" role="dialog" aria-hidden="true" >

	<div class="modal-dialog" role="document">

		<div class="modal-content animated bounceInRight" >

			<div class="modal-header">
				<h4 class="modal-title">选择冲销日记账期间</h4>
				<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
			</div>

			<div class="modal-body" style="padding-bottom: 20px;">
				<%-- 导入提示信息框 --%>
				<c:if test="${hint!=null&&hint!=''}">
			   		<jsp:include page="../../common/alert/alert.jsp">
			   			<jsp:param value="${hint}" name="alertType"/>
			   			<jsp:param value="${alertMessage}" name="alertMessage"/>
			   		</jsp:include>
			    </c:if>
			
				<form id="lineForm">
					
					<div class="form-group row">
						<label class="col-sm-3 col-form-label">会计期间</label>
						<div class="col-sm-9">
							<select class="form-control" id="reversePeriodName" name="reversePeriodName">
	                        	<option value="" selected="selected">请选择...</option>
	                            <c:forEach items="${requestScope.calendarPeriodList}" var="calendarPeriod">
	                        		<option value="${calendarPeriod.periodName}">${calendarPeriod.periodName}</option>
	                        	</c:forEach>
	                        </select>
						</div>
					</div>
					<div class="hr-line-dashed"></div>

					<div class="form-group row m-b-none">
						<div class="col-sm-12 col-sm-offset-2 text-right">
							<button class="btn btn-white btn-lg" type="button"
								data-dismiss="modal">返回</button>
							&nbsp;
							<button
								class="ladda-button ladda-button-demo btn btn-primary btn-lg"
								data-style="expand-right">
								&nbsp;&nbsp;确定&nbsp;&nbsp;<i class="fa fa-check-square-o"></i>
							</button>
						</div>
					</div>
					
				</form>
			</div>

		</div>

	</div>

</div>


<script>
	$(document).ready(function() {
		//表单提交
		var l = $('.ladda-button-demo').ladda();

		l.click(function() {
			$("#lineForm").valid();
			//l.ladda('stop');
		});

		$("#lineForm").validate({
			rules : {
				reversePeriodName : {
					required : true,
				},
			},
			submitHandler: function(form) {
				redragonJS.confirm("确认日记账过账？此操作不可逆", function(){
					l.ladda('start');
					redragonJS.close();
					window.location.href='web/gLJeHead/postJeToGLPeriodName?periodName='+$("#reversePeriodName").val();
				});
		    }
		});
		
	});
	
</script>
